using System.Web;


namespace SCRUMPoker.Web {

    public class SessionAdapter : ISession
    {
        public Game CurrentGame
        {
            get { return ScrumPokerSession.CurrentGame; }
            set { ScrumPokerSession.CurrentGame = value; }
        }

        public Participant GameParticipant
        {
            get
            {
                return ScrumPokerSession.GameParticipant;
            }
            set
            {
                ScrumPokerSession.GameParticipant = value;
            }
        }
    }
    public interface ISession
    {
        Game CurrentGame { get; set; }
        Participant GameParticipant { get; set; }
    }
    /// <summary>
    /// Summary description for ScrumPokerSession
    /// </summary>
    public class ScrumPokerSession
    {
        private ScrumPokerSession()
        {
            
        }

		public static Game CurrentGame {
            get { return (Game)HttpContext.Current.Session["Game"]; }
            set { HttpContext.Current.Session["Game"] = value; }
        }

        public static Participant GameParticipant {
            get { return (Participant)HttpContext.Current.Session["Participant"]; }
            set { HttpContext.Current.Session["Participant"] = value; }
        }
    }
}
